package com.zhang.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;


@Api(tags = "用户实体类")
@Data
@NoArgsConstructor
@TableName(value = "t_user")
public class UserBean {

    @ApiModelProperty("用户id")
    @TableId(value = "pk_userId",type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("用户名")
    @TableField(value = "u_name")
    private String username;

    @ApiModelProperty("用户密码")
    @TableField(value = "u_pwd")
    private String pwd = "000000";

    @ApiModelProperty("用户真实名字")
    @TableField(value = "u_real")
    private String real;

    @ApiModelProperty("角色集合")
    private List<RoleBean> roleBeans;

    public UserBean(String username, String real, List<RoleBean> roleBeans) {
        this.username = username;
        this.real = real;
        this.roleBeans = roleBeans;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "id=" + id +
                ", name='" + username + '\'' +
                ", pwd='" + pwd + '\'' +
                ", real='" + real + '\n' +
                ", roleBeans=" + roleBeans +
                '}' + "\n";
    }
}
